package asteroids.model.expressions;

import java.util.HashMap;

import asteroids.model.*;

/**
 * A subclass of expression (E) that represents the ship self
 * 
 * @version 1.0
 * 
 * @author	Thijs Peirelinck & Wouter Parys
 *
 */
public class Self extends ExecuterExpression {
	
	
	public Self(){
	}
	
	@Override
	public boolean isValidExpression() {
		return true;
	}
	
	@Override
	public FlyingObject getValue() {
		return getExecuter();
	}
	
	@Override
	public String getReturnType() {
		return "entity";
	}
	
	@Override
	public String toString() {
		return "self";
	}
	
	@Override
	public void validate(HashMap<String, E> variables) {
		//do nothing
	}
	
	@Override
	public E createCopy() {
		Self self = new Self();
		assert (this.getExecuter() != null);
		self.setExecuter(getExecuter());
		return self;
	}

}
